<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>开单页面</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/resources/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/resources/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <script src="/resources/js/echarts.min.js"></script>
    <link rel="stylesheet" href="/resources/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/resources/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="/resources/css/app.css">
    <script src="/resources/js/jquery.min.js"></script>

    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style type="text/css">
        body input{border-bottom:0}
    </style>
</head>

<body data-type="widgets">
<script src="/resources/js/theme.js"></script>
<div class="am-g tpl-g">
    <%--头部开始--%>
    <%@include file="header.jsp" %>
    <%--头部结束--%>


    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf" style="font-size: 11px;">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">开单流程第三步</div>
                            <small>会诊、处方开具</small>
                        </div>

                        <div class="widget-body  am-fr">

                            <!-- 编辑栏 -->
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                <div class="am-form-group">
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- 下拉框 -->
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                            </div>
                            <!-- 搜索框 -->
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                </div>
                            </div>
                            <script>
                                // $("body").keydown(function () {
                                //     var hasFocus = $('#searchContent').is(':focus');
                                //     if (event.keyCode == "13") {//keyCode=13是回车键
                                //         if (hasFocus == true) {
                                //             searchInfo();
                                //         } else {
                                //             alert("全局")
                                //         }
                                //     }
                                // });

                                function checkValue(type, content) {
                                    if (content === null || content === undefined || content === '' || content.length === 0) {
                                        return false;
                                    }
                                    // var phoneRex = /^1[34578]\d{9}$/;
                                    var phoneRex = /^\d{3,}$/;
                                    var otherRex = /^\w+$/;
                                    var otherRex1 = /^[\u2E80-\u9FFF]+$/;
                                    if (content.length > 200) {
                                        alert("输入的数据过长");
                                        return false;
                                    }
                                    if (type == "phone") {
                                        //电话号码校验
                                        if (phoneRex.test(content)) {
                                            return true;
                                        } else {
                                            alert("请输入三个以上的数字")
                                        }
                                    } else {
                                        if (otherRex.test(content) || otherRex1.test(content)) {
                                            return true;
                                        } else {
                                            alert("请输入正确的信息")
                                        }
                                    }
                                    return false;
                                }

                                function setValue(res) {
                                    //纸质档案编号
                                    $("#fileNo").attr("value", res.babyInfo.fileNo);
                                    //宝宝姓名
                                    $(".babyName").attr("value", res.babyInfo.babyName);
                                    //宝宝图片
                                    $(".imagePhoto").attr("src", res.babyInfo.babyPhoto);
                                    //宝宝性别
                                    $(".babySex").val(res.babyInfo.babySex);
                                    //是否早产
                                    $(".premature").val(res.babyInfo.premature);
                                    //宝宝年龄
                                    $(".babyAge").attr("value", res.babyInfo.babyAge);
                                    //宝宝身高
                                    $(".babyHeight").attr("value", res.babyInfo.babyHeight);
                                    //宝宝体重
                                    $(".babyWeight").attr("value", res.babyInfo.babyWeight);
                                    //宝宝出生日期
                                    var time = new Date(res.babyInfo.babybirthday);
                                    var year = time.getFullYear();
                                    var month = time.getMonth() + 1;
                                    var date = time.getDate();
                                    var t = year + "-" + month + "-" + date;
                                    $(".birthday").attr("value", t);
                                    //喂养史
                                    // $(".feedHistory").attr("value",res.babyInfo.feedHistory);
                                    $(".feedHistory").val(res.babyInfo.feedHistory);
                                    //过敏史
                                    $(".allergyHistory").val(res.babyInfo.allergyHistory);
                                    //病史
                                    $(".sickHistory").val(res.babyInfo.sickHistory);
                                    //备注
                                    $(".babyNote").val(res.babyInfo.babyNote);
                                    //会员卡类型
                                    $(".vipcategory").val(res.vipCard.vipName);
                                    //会员卡号码
                                    $(".vipNo").val(res.vipInfo.vipNo);
                                    //父母姓名
                                    $(".pname").val(res.userInfo.userName);
                                    //父母电话
                                    $(".phone").val(res.userInfo.userTel);
                                    //卡余额或者剩余次数

                                    if (res.vipCard.vipLevel == 0) {
                                        //体验卡
                                        $(".vipSum").val("剩余" + res.vipInfo.remainTime + "次消费")
                                    } else {
                                        //其他会员等级的卡
                                        $(".vipSum").val("剩余" + res.vipInfo.balance + "元")
                                    }

                                }

                                function searchInfo() {
                                    var type = $("#searchType").val();
                                    var content = $("#searchContent").val();
                                    if (checkValue(type, content)) {
                                        var data = new FormData();
                                        data.append("type", type);
                                        data.append("content", content);
                                        var URL = "/process/search";
                                        $.ajax({
                                            url: URL,
                                            type: 'POST',
                                            cache: false,
                                            data: data,
                                            async: false,
                                            processData: false,
                                            contentType: false
                                        }).done(function (res) {
                                            console.log(res);
                                            $("#info").empty();
                                            for (var i = 0; i < res.length; i++) {
                                                var tmp = res[i];
                                                setValue(tmp);
                                                $("#info").prepend("<li><a class='searchOne' href=\"javascript:findOne(" + tmp.userInfo.id + ");\">" + "宝宝姓名：" + tmp.babyInfo.babyName + "&emsp;父母姓名：" + tmp.userInfo.userName + "&emsp;会员卡号：" + tmp.vipInfo.vipNo + "&emsp;电话号码：" + tmp.userInfo.userTel + "</a></li>");
                                            }
                                            console.log(res);
                                        }).fail(function (res) {
                                            console.log(res);
                                            alert("数据异常")
                                        });
                                    }

                                    //     console.log(type + "===" + content);

                                }

                                function findOne(id) {
                                    var data = new FormData();
                                    data.append("uid", id);
                                    var URL = "/process/one";
                                    $.ajax({
                                        url: URL,
                                        type: 'POST',
                                        cache: false,
                                        data: data,
                                        async: false,
                                        processData: false,
                                        contentType: false
                                    }).done(function (res) {
                                        console.log(res);
                                        $("#info").empty();
                                        if (res === null || res === undefined || res === '') {
                                            alert("该用户数据异常")
                                        } else {
                                            setValue(res);
                                        }
                                    }).fail(function (res) {
                                        console.log(res);
                                        alert("网络错误，请重新操作")
                                    });
                                }
                            </script>
                            <%--症状显示start--%>
                            <!-- 用户数据显示 -->

                        </div>
                        <%--症状显示end--%>
                        <div class="am-u-sm-12  am-u-md-3 am-u-lg-3" style="margin-top:30px;">
                            <!-- 宝宝姓名-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-3 am-form-label" style="padding-top: 5%">宝宝姓名</label>
                                <div class="am-u-sm-7">
                                    <input type="text" name="babyName" id="babyName"
                                           class="am-form-field tpl-form-no-bg babyName"
                                           placeholder="" maxlength="4" readonly/>
                                </div>

                            </div>
                            <!-- 宝宝性别===性别校验-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-md-2 am-u-lg-3 am-form-label" style="padding-top: 5%">宝宝性别</label>
                                <div class="am-u-sm-7">
                                    <input type="text" id="babySex" name="premature"
                                           class="am-form-field tpl-form-no-bg babySex"
                                           placeholder="" readonly/>
                                </div>
                            </div>
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-md-2 am-u-lg-3 am-form-label" style="padding-top: 5%">是否早产</label>
                                <div class="am-u-sm-7">
                                    <input type="text" id="premature" name="premature"
                                           class="am-form-field tpl-form-no-bg babyAge"
                                           placeholder="" readonly/>
                                </div>
                            </div>

                            <!-- 宝宝年龄-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-3 am-form-label" style="padding-top: 5%">宝宝年龄</label>
                                <div class="am-u-sm-7">
                                    <input type="text" id="babyAge" name="babyAge"
                                           class="am-form-field tpl-form-no-bg babyAge"
                                           placeholder="" readonly/>
                                </div>

                            </div>

                            <!-- 宝宝体重-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-3 am-form-label" style="padding-top: 5%">宝宝体重</label>
                                <div class="am-u-sm-7">
                                    <input type="text" id="babyWeight" name="babyWeight"
                                           class="am-form-field tpl-form-no-bg babyWeight"
                                           placeholder="" maxlength="4" readonly/>
                                </div>

                            </div>

                            <!-- 宝宝身高-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-3 am-form-label" style="padding-top: 5%">宝宝身高</label>
                                <div class="am-u-sm-7">
                                    <input type="text" name="babyHeight" id="babyHeight"
                                           class="am-form-field tpl-form-no-bg babyHeight"
                                           placeholder="" maxlength="3" readonly/>
                                </div>

                            </div>

                            <!-- 喂养史-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-4 am-u-md-4 am-u-lg-4 am-form-label" style="padding-top: 7%">喂养史</label>
                                <div class="am-u-sm-8  am-u-md-8 am-u-lg-8">
                                    <textarea name="feedHistory" id="feedHistory"
                                              class="am-form-field tpl-form-no-bg feedHistory"
                                              placeholder="" maxlength="200" readonly></textarea>
                                </div>

                            </div>

                            <!-- 过敏史-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-4 am-form-label" style="padding-top: 7%">过敏史</label>
                                <div class="am-u-sm-8">
                                    <textarea name="allergyHistory" id="allergyHistory"
                                              class="am-form-field tpl-form-no-bg allergyHistory"
                                              placeholder="" maxlength="200" readonly></textarea>
                                </div>
                            </div>

                            <!-- 病史-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-4 am-form-label" style="padding-top: 7%">病史</label>
                                <div class="am-u-sm-8">
                                    <textarea name="sickHistory" id="sickHistory"
                                              class="am-form-field tpl-form-no-bg sickHistory"
                                              placeholder="" maxlength="200" readonly></textarea>
                                </div>
                                <div class="am-u-sm-2">
                                </div>
                            </div>
                            <!-- 备注-->
                            <div class="am-u-md-12 am-u-lg-12">
                                <label class="am-u-sm-4 am-form-label" style="padding-top: 7%">备注</label>
                                <div class="am-u-sm-8">
                                    <textarea id="notes" name="babyNote" class="am-form-field tpl-form-no-bg babyNote"
                                              placeholder="" maxlength="200" readonly></textarea>
                                </div>
                            </div>
                            <div class="am-u-sm-12  am-u-md-12 am-u-lg-12" id="sysPtdom-detail" style="height: 40px"></div>
                        </div>

                        <div class="am-u-sm-12 am-u-md-9 am-u-lg-9" style="margin-top: 30px;">
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12" id="detail-content"></div>
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                                <div class="am-u-md-12 am-u-lg-12">
                                    <div class="am-u-md-12 am-u-lg-12">
                                        <h4 class="am-text-center">儿童餐和食品及产品类</h4>
                                        <table width="100%" class="am-table">
                                            <thead>
                                            <tr>
                                                <th class="am-text-center">名称</th>
                                                <th class="am-text-center">用量</th>
                                                <th class="am-text-center">价格 </th>
                                            </tr>
                                            </thead>
                                            <tbody id="preDetils">
                                            <%--  <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                                  <td class="am-text-center">100元 </td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>--%>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="am-u-md-12 am-u-lg-12">
                                        <h4 class="am-text-center">推拿、艾灸、贴服等</h4>
                                        <table width="100%" class="am-table">
                                            <thead>
                                            <tr>
                                                <th class="am-text-center">名称</th>
                                                <th class="am-text-center">用量</th>
                                                <th class="am-text-center">价格 </th>
                                            </tr>
                                            </thead>
                                            <tbody id="acupDetails">
                                            <%--  <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                                  <td class="am-text-center">100元 </td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>
                                              <tr>
                                                  <td class="am-text-center">白菜</td>
                                                  <td class="am-text-center">1g</td>
                                              </tr>--%>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="am-u-md-12 am-u-lg-12 am-text-left">
                                        <label>诊断结果:&nbsp;&nbsp;&nbsp;</label>
                                        <label id="resultP" style="font-size: 15px"></label>
                                    </div>
                                    <div class="am-u-md-12 am-u-lg-12 am-text-left">
                                        <label>备注:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                                        <label id="noticeP" style="font-size: 15px"></label>
                                    </div>
                                    <div class="am-u-md-12 am-u-lg-12 am-text-left">
                                        <label>价格:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                                        <del id="sumPrice" style="font-size: 15px;color: red"></del>
                                    </div>

                                    <div class="am-u-md-12 am-u-lg-12 am-text-left">
                                        <label>打折后价格:&nbsp;&nbsp;&nbsp;</label>
                                        <label id="sumPrice1" style="font-size: 15px;color: red"></label>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<!-- 图片显示模态框 -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="sysType_enter">
    <div class="am-modal-dialog" style="width:700px;height:500px;">
        <div class="am-modal-bd">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title am-fl">照片显示</div>
                            <div class="widget-function am-fr">
                                <a href="javascript: void(0)" class="am-close am-close-spin close_a"
                                   data-am-modal-close>&times;</a>
                            </div>
                        </div>
                        <div class="widget-body am-fr">
                            <form class="am-form tpl-form-border-form tpl-form-border-br">
                                <div id="myCarousel" class="carousel slide" style="width:100%;height:100%;margin:auto;">
                                    <!-- 轮播（Carousel）项目 -->
                                    <div class="carousel-inner">
                                        <!-- <div class="item active">
                                            <img class="firstimg"  src="" style="width:280px;height:250px;margin:auto 10px;" alt="照片">
                                        </div> -->
                                    </div>
                                    <!-- 轮播（Carousel）导航 -->
                                    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                                        <span class="sr-only">Previous</span>
                                    </a>
                                    <a class="right carousel-control" href="#myCarousel" role="button"
                                       data-slide="next">
                                        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                                        <span class="sr-only">Next</span>
                                    </a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 模态框 -->


<script src="/resources/js/amazeui.min.js"></script>
<script src="/resources/js/amazeui.datatables.min.js"></script>
<script src="/resources/js/dataTables.responsive.min.js"></script>
<script src="/resources/js/app.js"></script>
<script>
    var allInfo = new Array();
    var id = '${illCase.illCaseId}';
    // var id =21;
    $(function () {
        var URL = "/process/getillcasedetail";

        var formdata = new FormData();
        formdata.append("illCaseId", id);
        /*        formdata.append("illCaseState", 1);*/
        $.ajax({
            url: URL,
            type: "POST",
            data: formdata,
            cache: false,
            async: false,
            processData: false,
            contentType: false
        }).done(function (res) {
            console.log(res);
            if (res == null || res == '' || res == undefined) {
                alert("该信息不存在！");
                window.location.href = '/process/third';
                return;
            }
            //   var sysmptoms = eval(res.sysmptom);
            var tt ="["+res.sysmptom+"]";
            console.log(tt);

            var sysmptoms =JSON.parse(tt);
            console.log(sysmptoms);
            //    var dital = $('#sysPtdom-detail');
            var dital = $('#detail-content');
            for (var i = 0; i < sysmptoms.length; i++) {
                //解析图片
                if (sysmptoms[i].domtype == 3) {
                    sysmptoms[i].index = i;
                    allInfo.push(sysmptoms[i]);
                    var sdiv = ' <div class="am-u-md-4 am-u-lg-4"><label class="am-u-sm-3 am-form-label">' + sysmptoms[i].sysmpinstruct + '</label>' +
                        '<a class="am-u-sm-7" id="' + sysmptoms[i].index + '" href="javascript: getImagesModel(' + sysmptoms[i].index + ')">点击查看图片</a>' +
                        '</div></div>';
                    dital.prepend(sdiv);
                } else {
                    var sysptom = sysmptoms[i];
                    var sdiv = ' <div  class="am-u-md-4 am-u-lg-4"><label class="am-u-md-3 am-form-label">' + sysptom.sysmpinstruct + '</label> <div class="am-u-sm-7">' +
                        ' <input type="text" class="am-form-field tpl-form-no-bg babyHeight" value="' + sysptom.value + '"readonly />' +
                        '</div></div>';
                    dital.prepend(sdiv);
                }
            }

            var babyData = new FormData();
            console.log(res);
            var burl = '/babyInfoController/findOneBabyInfo';
            babyData.append("babyId", res.babyId);
            console.log("宝宝信息");
            $.ajax({
                url: burl,
                type: "POST",
                data: babyData,
                cache: false,
                async: false,
                processData: false,
                contentType: false
            }).done(function (res) {
                console.log(res);
                setValue(res.bb);
            });


        }).fail(function (res) {
            alert("网络错误，请检查数据是否完整");
        });
        ;
    });

    function getImagesModel(dom) {
        var tmpInfo;
        for (var i = 0; i < allInfo.length; i++) {
            if (allInfo[i].index == dom) {
                tmpInfo = allInfo[i];
            }
        }
        if (tmpInfo != undefined && tmpInfo != undefined && tmpInfo != '') {
            var images = tmpInfo.value.split(",");
            $(".carousel-inner").empty();
            for (var j = 0; j < images.length; j++) {
                if (j == 0) {
                    var first_div = '<div class="item active"><img class="firstimg" src="' + images[j] + '"style="width:660px;height:360px;margin:auto;" alt="照片"></div>';
                    $(".carousel-inner").append(first_div);
                } else {
                    var div = '<div class="item"><img src="' + images[j] + '"style="width:660px;height:360px;margin:auto;" alt="照片"></div>';
                    $(".carousel-inner").append(div);
                }
            }
            $('#sysType_enter').modal({closeViaDimmer: 0});
        } else {
            alert("数据异常");
        }
    }


    function setValue(obj) {
        $('#babyName').val(obj.babyName);
        if (obj.babySex==1){
            $('#babySex').val('男');
        }else {
            $('#babySex').val('女');
        }
        //是否早产
        if (obj.premature==1){
            $('#premature').val('是');
        } else {
            $('#premature').val('否');
        }
        $('#babyAge').val(obj.babyAge);
        $('#notes').val(obj.babyNote);
        $('#babyWeight').val(obj.babyWeight + 'kg');
        $('#babyHeight').val(obj.babyHeight + 'cm');
        $('#feedHistory').val(obj.feedHistory);
        $('#allergyHistory').val(obj.allergyHistory);
        $('#sickHistory').val(obj.sickHistory);

    }

    $("#restBaby").click(function () {
        window.location.href="/process/regetIllCase?id="+id;
    });

    $(function () {
        var illid = id;
        var formData = new FormData();
        console.log(illid);
        formData.append("illid",illid);
        url = '/illCaseController/getpre';
        $.ajax({
            url: url,
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false
        }).done(function (res) {
            if (res.success) {
                $('preDetils').empty();
                $('#docName').html(res.data.temId);
                $('#sumPrice').html(res.data.reserve1);
                $('#sumPrice1').html(res.data.reserve4);
                if(res.data.reserve2 == "null" || res.data.reserve2 == null){
                    $('#noticeP').html("无");
                }else {
                    $('#noticeP').html(res.data.reserve2+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+res.data.reserve15);
                }
                if(res.data.reserve3 == "" || res.data.reserve3 == ' ' || res.data.reserve3 == null){
                    $('#resultP').html("无");
                }else {
                    $('#resultP').html(res.data.reserve3);
                }
                var detils = JSON.parse('['+res.data.presDetail+']');
                var s1 ='';
                var s2 ='';
                for (var i = 0;i<detils.length;i++){
                    var tmp =  detils[i];
                    if (tmp.pretype == 'dietary'){
                        s1+='<tr><td class="am-text-center">'+tmp.prename+'</td><td class="am-text-center">'+tmp.precount+tmp.premeasure+'</td><td class="am-text-center">'+tmp.preprice+'元 </td></tr>';
                    }else {
                        s2+='<tr><td class="am-text-center">'+tmp.prename+'</td><td class="am-text-center">'+tmp.precount+tmp.premeasure+'</td><td class="am-text-center">'+tmp.preprice+'元 </td></tr>';
                    }
                }
                console.log(s1);
                if (s1 == ''){
                    s1+='<tr><td class="am-text-center" colspan="3">无信息</td></tr>';
                }
                $('#preDetils').append(s1);
                if (s2 == ''){
                    s2+='<tr><td class="am-text-center" colspan="3">无信息</td></tr>';
                }
                $('#acupDetails').append(s2);

            }else {
                alert(res.msg);
            }
        }).fail(function (res) {
            alert("网络错误");

            //  return res;
        });

    });

</script>
</body>
</html>